#pragma once
#include <glog/logging.h>
#include <string>

class SrpcLogger {
public:
  explicit SrpcLogger(const char *argv) {
    google::InitGoogleLogging(argv);
    FLAGS_colorlogtostderr = true; // 启用彩色日志
    FLAGS_logtostderr = true;      // 默认输出标准错误
  }
  ~SrpcLogger() { google::ShutdownGoogleLogging(); }
  // 静态日志方法
  static inline void INFO(const std::string &message) { LOG(INFO) << message; }
  static inline void WARNING(const std::string &message) {
    LOG(WARNING) << message;
  }
  static inline void ERROR(const std::string &message) {
    LOG(ERROR) << message;
  }
  static inline void FATAL(const std::string &message) {
    LOG(FATAL) << message;
  }

private:
  SrpcLogger(const SrpcLogger &) = delete;
  SrpcLogger &operator=(const SrpcLogger &) = delete;
};